
public class EntryTS {
	public static final int NIL = -1; // entrada nula, error
	public static final int UDEC = 0; /* not declared */
	public static final int FUNC = 1; /* fuction */
	public static final int UFUNC = 2; /* undefined function */
	public static final int VAR = 3; /* declared variable */
	public static final int PARAM = 4; /* undeclared parameter */
	
	//public static final int TYPE = 5; //int o long
	
	private String name; // lexema
	private int kind; // tipo de simbolo. esto por ahora esta muy simplificado
	private int blockLevel; // profundidad de nivel
	private long value; //si es un int o long
	private int tipo; //para saber si es int o long (si es funcion tipo de retorno)
	//private EntryTS next; /* next entry */
	
	private static String[] kindStrings = { "UDEC" , "FUNC", "UFUNC", "VAR", "PARAM" };
		
	public static String getKindStr(int id) {
		return kindStrings[id];
	}
	
	public EntryTS() {
		this.name = " ";
		this.kind = NIL; //nula, error.
		this.blockLevel = 1;
	}
	
	public EntryTS(String name, int kind, int blockLevel, long value, int tipo) {
		this.name = name;
		this.kind = kind;
		this.blockLevel = blockLevel;
		this.value = value;
		this.tipo = tipo;
		//this.next = next;
	}
	
	public EntryTS(String name, int kind, int blockLevel) {
		this.name = name;
		this.kind = kind;
		this.blockLevel = blockLevel;
	}
	
	public long getValue() {
		return value;
	}

	public void setValue(long value) {
		this.value = value;
	}

	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public int getKind() {
		return kind;
	}
	
	public void setKind(int kind) {
		this.kind = kind;
	}
	
	public int getBlockLevel() {
		return blockLevel;
	}
	
	public void setBlockLevel(int blockLevel) {
		this.blockLevel = blockLevel;
	}

	@Override
	public String toString() {
		return "EntryTS [name=" + name + ", kind=" + getKindStr(kind) + ", blockLevel="
				+ blockLevel + ", value=" + value + ", tipo=" + tipo + "]";
	}

	public int getTipo() {
		return tipo;
	}

	public void setTipo(int tipo) {
		this.tipo = tipo;
	}
	
}
